﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Core;
namespace MvcWebUI.Controllers
{
    public class DonViController : Controller
    {
        //
        // GET: /DonVi/

        public ActionResult Index()
        {
            var model = DonVi.All();
            return View(model);
        }
        [HttpPost]
        public ActionResult AddNew(string TenDonVi)
        {
            var entity = new DonVi
            {
                ID = -1,
                TenDonVi = TenDonVi
            };
            DonVi.Add(entity);
            return RedirectToAction("Index");
        }
    }
}
